Don't output bounding box if we couldn't compute them (i.e. tracks and routes)
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 19 Jan 2004 18:10:29 +0000 (18:10 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 19 Jan 2004 18:10:29 +0000 (18:10 +0000)
gpsbabel/gpx.c

index 975e7f5b704668182801eb7118315151953de8dc..b05518b5799c3f7529caa95e4580f2e0d5342b83 100644 (file)
@@ -1134,12 +1134,14 @@ gpx_write(void)
        fprintf(ofd, "xmlns=\"http://www.topografix.com/GPX/1/0\"\n");
        fprintf(ofd, "xsi:schemaLocation=\"%s\">\n", xsi_schema_loc ? xsi_schema_loc : DEFAULT_XSI_SCHEMA_LOC);
 
-        gpx_write_time( now, "time" );
+       gpx_write_time( now, "time" );
        waypt_compute_bounds(&bounds);
-       fprintf(ofd, "<bounds minlat=\"%f\" minlon =\"%f\" "
-                      "maxlat=\"%f\" maxlon=\"%f\" />\n",
-                      bounds.min_lat, bounds.min_lon, 
-                      bounds.max_lat, bounds.max_lon);
+       if (bounds.max_lat  < 360) {
+               fprintf(ofd, "<bounds minlat=\"%f\" minlon =\"%f\" "
+                              "maxlat=\"%f\" maxlon=\"%f\" />\n",
+                              bounds.min_lat, bounds.min_lon, 
+                              bounds.max_lat, bounds.max_lon);
+       }
        waypt_disp_all(gpx_waypt_pr);
        gpx_track_pr();
        gpx_route_pr();